import {
    center,
    input,
} from '@/css/DialogsCss.module.scss';
export default {
    title:'新增编辑',
    dialog:{
        size:'50%'
    },
    onMounted: [{
        action:'print',
        value:'$params'
    },{
        action:'set',
        target: '$view',
        field:'title',
        value:'$params.title'
    },{
        action: 'set',
        target: '$widgets.form',
        field: 'value',
        value: '$params.form'
    }],
    items: [{
        region: 'center',
        class: center,
        layout: 'vertical',
        items: [{
            layout: 'vertical',
            items: [{
                id: 'form',
                widget: 'form',
                layout: {
                    type:'gridform',
                    column:2
                },
                fields:[{
                    class: input,
                    itemId:'name',
                    placeholder:'请输入项目名称',
                    widget:'text',
                    label:'项目名称',
                },{
                    class: input,
                    itemId:'description',
                    placeholder:'请输入项目描述',
                    widget:'text',
                    label:'项目描述',
                },{
                    class: input,
                    itemId:'organization_uuid',
                    placeholder:'请选择组织',
                    widget:'select',
                    dictionary: 'common/dictionary/organization',
                    label:'组织',
                },{
                    class: input,
                    itemId:'category_uuid',
                    placeholder:'请选择项目类型',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'pm_standard_category',
                            module: 'project',
                        },
                    },
                    label:'项目类型',
                },{
                    class: input,
                    itemId:'source_uuid',
                    placeholder:'请选择项目来源',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'pm_standard_source',
                            module: 'project',
                        },
                    },
                    label:'项目来源',
                },{
                    class: input,
                    itemId:'status_uuid',
                    placeholder:'请选择项目状态',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'pm_standard_statue',
                            module: 'project',
                        },
                    },
                    label:'项目状态',
                },{
                    class: input,
                    itemId:'label_uuid',
                    placeholder:'请选择项目标签',
                    widget:'select',
                    dictionary: {
                        path: 'common/dictionary/config',
                        params: {
                            name: 'pm_standard_label',
                            module: 'project',
                        },
                    },
                    label:'项目标签',
                },{
                    class: input,
                    itemId:'customer_uuid',
                    placeholder:'请选择客户(公司)',
                    widget:'select',
                    dictionary: 'common/dictionary/customer',
                    label:'客户(公司)',
                },{
                    class: input,
                    itemId:'contact_uuid',
                    placeholder:'请选择客户联系人',
                    widget:'select',
                    dictionary: 'common/dictionary/contact',
                    label:'客户联系人',
                },{
                    class: input,
                    itemId:'phone',
                    placeholder:'请输入联系电话',
                    widget:'text',
                    label:'联系电话',
                },{
                    class: input,
                    itemId:'director_uuid',
                    placeholder:'请选择负责人',
                    widget:'select',
                    dictionary: 'common/dictionary/salesman',
                    label:'负责人',
                },{
                    class: input,
                    itemId:'member_uuid',
                    placeholder:'请选择指派人',
                    widget:'select',
                    dictionary: 'common/dictionary/salesman',
                    label:'指派人',
                },{
                    class: input,
                    itemId:'priority',
                    placeholder:'请选择优先等级',
                    widget:'select',
                    dictionary: 'common/static/priority',
                    label:'优先等级',
                },{
                    class: input,
                    itemId:'is_starred',
                    placeholder:'请选择是否标星',
                    widget:'select',
                    dictionary: 'common/static/starred',
                    label:'是否标星',
                }],
                buttons: [{
                    value: '保存',
                    type: 'primary',
                    onClick: [{
                        action: 'confirm',
                        title: '表单保存',
                        message: '是否保存表单?',
                        confirm: [{
                            var:'value',
                            target:'$widget',
                            action:'call',
                            method:'getValue'
                        },{
                            action: 'service',
                            path: 'pmstandard/project/list/save',
                            params:{
                                category_uuid:'$params.category_uuid',
                                '...':['$vars.value']
                            }
                        },{
                            action:'dialog-hide',
                            mode:'apply'
                        }]
                    }]
                }],
                flex: true
            }]
        }]
    }]
};


